package wsepForum.common.elements;

import java.util.Vector;

/**
 *
 * @author Ofir Tam & Ori Ossmy
 *
 */
public class SectionHeader extends AForumElement {


	/*****************************
	 * MEMBERS                   *
	 *****************************/

	/**
	 *
	 */
	private TopicHeader newestTopicHeader;

	/**
	 *
	 */
	protected Vector<String> sectionAdmins;


	/*****************************
	 * CONSTRUCTOR               *
	 *****************************/
	/**
	 *
	 * @param headLine
	 */
	public SectionHeader(String headLine, int parentID) {
		super(headLine, parentID);
		sectionAdmins = new Vector<String>();
	}


	/*****************************
	 * METHODS                   *
	 *****************************/
	/**
	 *
	 * @return
	 */
	public TopicHeader getNewestTopic() {
		return this.newestTopicHeader;
	}


	/**
	 *
	 * @param topicHeadline
	 */
	public void setNewestTopic(TopicHeader topicHeader) {
		this.newestTopicHeader = topicHeader;
	}

	/**
	 *
	 * @param user
	 */
	public void addSectionMod(String user) {
		this.sectionAdmins.add(user);
	}

	/**
	 *
	 * @param user
	 */
	public void removeSectionMod(String user) {
		this.sectionAdmins.remove(user);
	}

	/**
	 *
	 * @param index
	 * @return
	 */
	public boolean isSectionMod(String user) {
		return this.sectionAdmins.contains(user);
	}

	/**
	 *
	 * @return
	 */
	public Vector<String> getAllSectionMods() {
		return this.sectionAdmins;
	}

	/**
	 *
	 */
	public ForumElementType elementIdetitity(){
		return ForumElementType.SECTION;
	}

}
